/*
 * GContactsService.java
 *
 * Created on October 10, 2008, 8:38 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package gcontactsservice;

//import ContactsExample;
import com.google.gdata.util.AuthenticationException;
import java.io.StringWriter;
import java.net.MalformedURLException;
import java.util.Map;
import java.util.TreeMap;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import mainpackage.ContactsExample;
import mainpackage.ContactsExampleParameters;

/**
 *
 * @author sharif.ahmed
 */
@WebService()
public class GContactsService {
    /**
     * Web service operation
     */
    @WebMethod
    public String testoperation(@WebParam(name = "s") String[] s) {
        try {
            // TODO implement operation 
/*            Map<String, String> mm = new TreeMap<String, String>();
            mm.put("username", "sharif.cse.buet.2000@gmail.com");
            mm.put("password", "Sha00026");
            mm.put("action", "list");
*/            //mm.put("", "");
            
            StringWriter sw = new StringWriter();
            ContactsExampleParameters parameters = new ContactsExampleParameters(s);
            ContactsExample example = new ContactsExample(parameters, sw);
            example.processAction(example, parameters);
            return example.getLastAddedId();//sw.toString();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }
    
}
